﻿<phone:PhoneApplicationPage
    x:Class="BudgetManager.Reports"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-
compatibility/2006"
    xmlns:ViewModels="clr-namespace:BudgetManager.ViewModels"
    xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Portrait" Orientation="Portrait"
    shell:SystemTray.IsVisible="True">
    <phone:PhoneApplicationPage.Resources>
        <!--Data template for Header-->
        <DataTemplate x:Key="expensesGrpHeaderTemplate">
            <Border Background="Transparent" Padding="5">
                <Border Background="{StaticResource PhoneAccentBrush}" BorderBrush="{StaticResource PhoneAccentBrush}" BorderThickness="2" Width="Auto" 
         Height="Auto" Margin="0,0,18,0" HorizontalAlignment="Left">
                    <TextBlock Text="{Binding Category}" Foreground="{StaticResource PhoneForegroundBrush}" FontSize="48" Padding="6" 
            FontFamily="{StaticResource PhoneFontFamilySemiLight}" HorizontalAlignment="Left" VerticalAlignment="Center"/>
                </Border>
            </Border>
        </DataTemplate>
        <!--Data Template For Items-->
        <DataTemplate x:Key="expensesItemTemplate">
            <StackPanel VerticalAlignment="Top">
                <TextBlock FontWeight="Bold"  Text="{Binding FirstName}" />
                <TextBlock Text="{Binding ExpenseDate}" />
                <TextBlock Text="{Binding ExpenseAmount}" />
                <TextBlock Text="{Binding Description}" />
            </StackPanel>
        </DataTemplate>
    </phone:PhoneApplicationPage.Resources>
    <phone:PhoneApplicationPage.ApplicationBar>
        <shell:ApplicationBar IsVisible="True">
            <shell:ApplicationBarIconButton IconUri="/Assets/Images/feature.search.png"  Text="Filter" Click="filterBtnClicked"></shell:ApplicationBarIconButton>
            <shell:ApplicationBarIconButton IconUri="/Toolkit.Content/ApplicationBar.Cancel.png"  Text="Clear Filter" Click="clearFilterBtnClicked"></shell:ApplicationBarIconButton>
        </shell:ApplicationBar>
    </phone:PhoneApplicationPage.ApplicationBar>

    <!--LayoutRoot is the root grid where all page content is placed-->
    <Grid x:Name="LayoutRoot" Background="Transparent">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>

        <!--TitlePanel contains the name of the application and page title-->
        <StackPanel Grid.Row="0" Margin="12,17,0,28">
            <TextBlock Text="MY BUDGET MANAGET" Style="{StaticResource PhoneTextNormalStyle}"/>
            <TextBlock Text="reports" Margin="9,-7,0,0" Style="{StaticResource PhoneTextTitle1Style}"/>
        </StackPanel>

        <!--ContentPanel - place additional content here-->
        <Grid d:DataContext="{d:DesignInstance Type=ViewModels:ExpenseReportViewModel, IsDesignTimeCreatable=True}" x:Name="ContentPanel" Grid.Row="1">
            <phone:LongListSelector x:Name="expensesList" GroupHeaderTemplate="{StaticResource expensesGrpHeaderTemplate}" ItemTemplate="{StaticResource expensesItemTemplate}" LayoutMode="List" IsGroupingEnabled="True" HideEmptyGroups="True">
                <phone:LongListSelector.Background>
                    <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                        <GradientStop Color="Black" Offset="0.008"/>
                        <GradientStop Color="White" Offset="1"/>
                        <GradientStop Color="#FF414141" Offset="0.996"/>
                    </LinearGradientBrush>
                </phone:LongListSelector.Background>
            </phone:LongListSelector>
        </Grid>

    </Grid>

</phone:PhoneApplicationPage>